'use strict';

const ComtrollerService = require('./render');
/**
 * 通用报名系列报名接口
*/
class CommonController extends ComtrollerService {
  constructor() {
    super(...arguments);

    this.tableName = 'tx_signupnew';

    this.downloadExcelHeader = [
      { header: '主键ID', key: 'id', width: 10 },
      { header: '活动ID', key: 'act_id', width: 10 },
      { header: '名称', key: 'name', width: 15 },
      { header: '手机号', key: 'phone', width: 15 },
      { header: '省份', key: 'province', width: 15 },
      { header: '城市', key: 'city', width: 15 },
      { header: '车系', key: 'series', width: 15 },
      { header: '车型', key: 'model', width: 15 },
      { header: '经销商', key: 'dealer', width: 15 },
      { header: '创建时间', key: 'createtime', width: 25 },
    ];
  }

  /**
   * 新增报名数据
  */
  async create() {
    const { ctx } = this;
    const result = await ctx.service.car.commonService.send(ctx.request.body);
    ctx.body = result;
  }
}

module.exports = CommonController;
